package com.example.module.shoppingCart.mapper;


import com.example.module.shoppingCart.DO.CartUpdateDO;
import com.example.module.shoppingCart.DO.ShoppingCartAddDO;
import com.example.module.shoppingCart.vo.GetShoppingCartVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ghy
 * @date 2025/08/28
 * @description 购物车Mapper
 */
@Mapper
@Repository
public interface ShoppingCartMapper {
    /*
     * 添加商品至购物车
     *
     * @param shoppingCartAddDO
     * @return void
     * */
    public void addShoppingCart(@Param("DO") ShoppingCartAddDO shoppingCartAddDO);

    /*
     * 从购物车中移除商品
     *
     * @param shoppingCartId
     * @return void
     * */
    public void deleteShoppingCart(Long shoppingCartId);

    /*
    *  根据商品Id查询对应收藏
    *
    * @param goodsId
    * @return getShoppingCartVO
    * */
    public GetShoppingCartVO getCartByGoodsId(Long goodsId);

    /*
     *  根据购物车Id查询对应收藏
     *
     * @param shoppingCartId
     * @return getShoppingCartVO
     * */
    public GetShoppingCartVO getCartByCartId(Long shoppingCartId);

    /*
    * 更新购物车
    *
    * @param CartUpdateDO
    * @return void
    * */
    public void updateCart(@Param("DO") CartUpdateDO cartUpdateDO);

    /*
     * 在购物车中 条件分页查询 商品
     *
     * @param getShoppingCartDO
     * @return page<GetShoppingCartVO>
     * */

}
